#ifndef MODELSINGLETON_H
#define MODELSINGLETON_H

#include <QObject>
#include <QDateTime>
#include <QSharedPointer>
#include <QJsonObject>
#include <QJsonArray>
#include <QRandomGenerator>


class ModelSingletonInterface
{
public:
    virtual ~ModelSingletonInterface()=default;

    virtual void fromJson(const QJsonObject& json)=0;
    virtual QJsonObject toJson()const=0;

protected:
    ModelSingletonInterface()=default;

};


template<typename T>
class ModelSingleton:public ModelSingletonInterface
{
public:
    static T& Instance()
    {
        static T instance;
        return instance;
    }

protected:
    ModelSingleton() = default;
    virtual ~ModelSingleton() = default;
};

#endif // MODELSINGLETON_H
